using RobotSimulator.Basic;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BasicInputer : BasicPublisher
{
    public string[] axis;
    public KeyCode[] keys;
    public float[] axis_values;
    public bool[] key_values;
    protected override void Start()
    {
        base.Start();
        axis_values = new float[axis.Length];
        key_values = new bool[keys.Length];
        for (int i = 0; i < axis.Length; i++)
        {
            axis_values[i] = 0;
        }
        for (int i = 0; i < keys.Length; i++)
        {
            key_values[i] = false;
        }
    }
    protected override void SetUp()
    {
        base.SetUp();
       
    }
    private void Update()
    {
        
        Control();
    }
    protected virtual void Control()
    {
        for (int i = 0; i < axis.Length; i++)
        {
            axis_values[i] = Input.GetAxis(axis[i]);
        }
        for (int i = 0; i < keys.Length; i++)
        {
            key_values[i] = Input.GetKey(keys[i]);
        }
    }

}
